<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<%@ include file="/jsp/imports/header.jsp" %>
	<script>
		function foward(acao){
			document.form.action = acao;
			document.form.submit();
		}
	</script>
</head>

<body>
<c:set var="page" value="jsp/professor/cronograma/profAlteraCronograma.jsp" scope="session"/>
<div class="contentwrap">
	
<div class="headwrap">


  <%@ include file="/jsp/imports/top.jsp" %>   
    


	<div class="container content">
		
	  <div class="span-20 append-2 prepend-2">
	  
	  
	   
        <%@ include file="/jsp/imports/mensagens.jsp" %>
  	
  	
    	
  <%@include file="/jsp/imports/menuLateral.jsp" %>
  



		  <div class="span-12 services last">
			<h2 align="center"><fmt:message key="cadastroCronograma.titulo" /></h2>
			<br/>
			<form action="alteraCronograma.do" method="post" name="form">
				<table>
					<tr>
						<td>
							<table align="right">
								<tr>
									<td><fmt:message key="data" /></td>
								</tr>
								<tr>
									<td>
										<select name="data">
											<c:forEach items="${atividades}" var="atividade">
												<option value="${atividade.idAtividade}"> <fmt:formatDate value="${atividade.data.time}" pattern="dd/MM/yyyy"/> </option>
											</c:forEach>
										</select>
									</td>
								</tr>
							</table>
						</td>
						<td>
							<table align="left">
								<tr>
									<td><fmt:message key="conteudos" /></td>
								</tr>
								<tr>
									<td>
										<select name="conteudoSelecao">
											<c:forEach items="${conteudos}" var="conteudo">
												<option value="${conteudo.idConteudo}"><c:out value="${conteudo.descricao}" /></option>
											</c:forEach>
										</select>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td><input type="button" value="<fmt:message key="botao.adicionarAtividade" />" onclick="foward('adicionarAtividadeCronograma.do?acao=alterar')"/></td>
						<td><input type="submit" value="<fmt:message key="botao.alterar" />"/></td>
					</tr>
				</table>
			</form>
			
			<br/>
			<table border="1">
				<tr>
					<th><fmt:message key="atividade"/></th>
					<th><fmt:message key="conteudo"/></th>
					<th><fmt:message key="acao.excluir"/></th>
				</tr>
				<c:forEach items="${cronograma.cronograma}" var="cronograma">
					<tr>
						<c:forEach items="${cronograma.value}" var="conteudo">
							<td align="center"><fmt:formatDate value="${cronograma.key.data.time}" pattern="dd/MM/yyyy"/></td>
							<td align="center"><c:out value="${conteudo.descricao}"/></td>
							<td align="center"><a href="excluirConteudoAtividade.do?idAtividade=<c:out value="${cronograma.key.idAtividade}"/>&idConteudo=<c:out value="${conteudo.idConteudo}"/>"><img alt="excluir" src="${pageContext.request.contextPath}/images/icons/delete.png"></img></a></td>
						</c:forEach>
					</tr>
				</c:forEach>
			</table>
		  </div>
			
		  <div class="final"></div>
		
		</div>
	
	</div>

</div>

</div>

 
<%@ include file="/jsp/imports/footer.jsp" %>
</body>
</html>